package com.bingxue.edu.management.system.model.req;

import com.bingxue.edu.common.enums.CommonStatusEnum;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

/**
 * 创建或修改定时任务信息
 *
 * @author panbo
 * @since 2024/08/02 13:34
 */
@Data
@Schema(description = "创建或修改定时任务信息")
public class ScheduleJobReq {

    @Schema(description = "job编码")
    @NotBlank(message = "job编码不能为空")
    @Length(max = 32, message = "job编码长度不能超过 {max} 个字符")
    private String jobKey;

    @Schema(description = "job名称")
    @NotBlank(message = "job名称不能为空")
    @Length(max = 32, message = "job名称长度不能超过 {max} 个字符")
    private String jobName;

    @Schema(description = "定时表达式")
    @NotBlank(message = "定时表达式不能为空")
    @Length(max = 64, message = "定时表达式长度不能超过 {max} 个字符")
    private String cron;

    @Schema(description = "参数")
    @Length(max = 255, message = "参数长度不能超过 {max} 个字符")
    private String paramJson;

    @Schema(description = "初始化策略")
    @NotBlank(message = "初始化策略不能为空")
    @Length(max = 32, message = "初始化策略长度不能超过 {max} 个字符")
    private String initStrategy;

    @Schema(description = "是否记录日志")
    @NotNull(message = "是否记录日志不能为空")
    private Boolean saveLog;

    @Schema(description = "描述")
    @Length(max = 255, message = "描述长度不能超过 {max} 个字符")
    private String description;

    @Schema(description = "状态")
    @NotNull(message = "状态不能为空")
    private CommonStatusEnum status;
}
